AGou's Docs-v2

vuePress-theme-reco AGou-ops    2022
AGou's Docs-v2 AGou's Docs-v2

Choose mode

  • dark
  • auto
  • light
🕟时间线
🏠Home
🗺️Guide
📄其它
  • 📚Golang
  • 🚢K8s
版本
  • ver 1.0 (opens new window)
  • ver 2.0 (opens new window)
✨myBlog (opens new window)
GitHub (opens new window)
author-avatar

AGou-ops

2

文章

1

标签

🕟时间线
🏠Home
🗺️Guide
📄其它
  • 📚Golang
  • 🚢K8s
版本
  • ver 1.0 (opens new window)
  • ver 2.0 (opens new window)
✨myBlog (opens new window)
GitHub (opens new window)
  • Golang
    • Golang Basic
    • Golang fmt占位符
    • String Operate
    • Golang Pointer
    • Golang Errors&handler
    • Golang Interface
    • Golang Package manage
    • Golang Pkgs
    • Golang Testing
    • Golang File Operate
    • Golang Json
    • Golang 并发

vuePress-theme-reco AGou-ops    2022

字符串处理


AGou-ops

# 字符串处理

  • 修改字符串
func changeString() {
	s1 := "hello"
	// 强制类型转换
	byteS1 := []byte(s1)
	byteS1[0] = 'H'
	fmt.Println(string(byteS1))

	s2 := "博客"
	runeS2 := []rune(s2)
	runeS2[0] = '狗'
	fmt.Println(string(runeS2))
}
1
2
3
4
5
6
7
8
9
10
11
12
在 GitHub 上编辑此页! (opens new window)
上次更新: 2022/06/01, 14:44:58
最近更新
01
生命短暂,犹如露珠消散,人们在奔波中寻求答案。
03-09
02
人生天地之间,若白驹过隙,忽然而已。
05-06
更多文章 >
欢迎来到 AGou's Docs-v2
看板娘
展开